<template>
  <ul>
    <li v-for="(item, index) in list" :key="item">
      {{ item }}
      <button @click="deleteTask(index)">删除</button>
    </li>
  </ul>
</template>

<script>
export default {
  name: "DataLister",
  props: {
    list:Array
  },
  methods:{
    deleteTask(index){
      this.list.splice(index,1)
    }
  }
};
</script>

<style lang="scss" scoped>
li {
  list-style: none;
}
</style>
